package po.userPO;

import java.util.HashMap;

public class StudentPO extends UserPO {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	private HashMap<Integer, Double> GPA;
	private String departmentId;
	private int totalCredit;
	private int totalSelectedCredit;
	private int grade;



	public StudentPO(String id,String name,  String password,String departmentId,int totalCredit,int totalSelectedCredit,int grade) {
		super(id, name,password,0);
		this.departmentId=departmentId;
		this.totalCredit=totalCredit;
		this.totalSelectedCredit=totalSelectedCredit;
		this.grade=grade;
	}

	public int getGrade() {
		return grade;
	}

	public void setGrade(int grade) {
		this.grade = grade;
	}


	public HashMap<Integer, Double> getGPA() {
		return GPA;
	}

	public void setGPA(HashMap<Integer, Double> gPA) {
		GPA = gPA;
	}

	public double getGPA(int term) {
		if (GPA==null){
			return 0;
		}
		if (GPA.toString().equals("{}")){
			return 0;
		}
		if (GPA.get(term)==null){
			return 0;
		}
		double result=GPA.get(term);
		return result;
	}

	public void setGPA(int term,double gpa) {
		GPA.put(term, gpa);
	}

	public String getDepartmentId() {
		return departmentId;
	}

	public void setDepartmentId(String departmentId) {
		this.departmentId = departmentId;
	}

	public int getTotalCredit(){
		return totalCredit;
	}
	
	public void setTotalCredit(int totalCredit){
		this.totalCredit=totalCredit;
	}
	public int getTotalSelectedCredit(){
		return totalSelectedCredit;
	}
	
	public void setTotalSelectedCredit(int totalSelectedCredit){
		this.totalSelectedCredit=totalSelectedCredit;
	}

	

}
